package com.sharefang.aproject.net;

import com.sharefang.aproject.bean.BaseBean;
import com.sharefang.aproject.bean.FolderBean;
import com.sharefang.aproject.bean.NppBean;
import com.sharefang.aproject.bean.PptBean;
import com.sharefang.aproject.bean.UserBean;

import java.util.List;
import java.util.Map;

import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;
import rx.Observable;

/**
 * 所有的网络请求类
 * Created by Administrator on 2016/8/11.
 */

public interface APIService {
    @FormUrlEncoded
    @POST("api/{startType}/{startInfo}")
    Observable<BaseBean<UserBean>> postStart(@Path("startType") String startType,
                                            @Path("startInfo") String startInfo,
                                            @FieldMap() Map<String, Object> map);
    @GET("api/{startType}/{startInfo}")
    Observable<BaseBean<UserBean>> getStart(@Path("startType") String startType,
                                            @Path("startInfo") String startInfo,
                                            @QueryMap() Map<String, Object> map);

    @GET("api/ppt/{typeInfo}")
    Observable<BaseBean<List<PptBean>>> getPpt(@Path("typeInfo") String typeInfo,
                                               @QueryMap() Map<String, Object> map);

    @GET("api/ppt/{typeInfo}")
    Observable<BaseBean<List<FolderBean>>> getFolder(@Path("typeInfo") String typeInfo,
                                                     @QueryMap() Map<String, Object> map);

    @GET("api/npp/{typeInfo}")
    Observable<BaseBean<List<NppBean>>> getNpp(@Path("typeInfo") String typeInfo,
                                               @QueryMap() Map<String, Object> map);

    @GET("api/npp/firstClassCategory")
    Observable<BaseBean<List<String>>> getFirstCategory();
}
